package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Phone      string `gorm:"type:char(11);not null;comment:'手机号'"`
	Password   string `gorm:"type:char(32);not null;comment:'密码'"`
	UserStatus int    `gorm:"type:int;not null;comment:1-正常,2-冻结"`
}

func (u *User) GetCreate(phone string) error {
	return DB.Where("phone = ?", phone).Limit(1).Find(&u).Error
}
func (u *User) GetUser(id int) error {
	return DB.Where("id = ?", id).Limit(1).Find(&u).Error
}
